function [mW,mP,mProf0,mPProf0,mProf0_C,mPProf1,mPN,mPComp,mPOV] =...
    zambia_postanalyze(cp,rp,A,R,Npdf,PartProb,Nobs,Prof1,Prof0,EN,OV,Prof0_C)

alpha   = cp.alpha;     
eta     = cp.eta;       
mon     = cp.mon;          
cb      = cp.cb;

df      = rp.df;

% Welfare functions
B        = cb.*alpha.*Nobs + df.*Prof0;
C        = cb.*(Nobs>=35).*R.*eta + cb.*mon.*(R>0).*eta + A.*(eta-1);
W        = PartProb.*(B-C);

% Analysis
% All analysis assumes PartProb is binary (i.e. k=1)

mP  = mean(PartProb);                   % Average take up (participation)
mProf0 = mean(df.*Prof0-12+A);          % Expected ex ante profit, including non-takeup
mPProf0 = mean((df.*Prof0-12+A).*PartProb); % Expected ex ante profit, unconditional
mProf0_C = mean(df.*Prof0_C-12+A);      % Expected ex ante profit, with commitment (no dynamic updating--for OV calcs)
%mProf1 = mean(Prof1);                  % Realized profit (not PV), including non-takeup
mPProf1 = mean(Prof1.*PartProb);        % Realized profit (not PV), unconditional
%mN = mean(Nobs);                       % Mean tree survival, including non take up
mPN = mean(Nobs.*PartProb);             % Mean tree survival, unconditional
%mComp = mean(Nobs>=35);                % Mean compliance, including non take up
mPComp = mean((Nobs>=35).*PartProb);    % Mean compliance, unconditional
mC = mean(C);                           % Average social costs
mB = mean(B);                           % Average social benefits
mW  = mean(W);                          % Average welfare
%mEN = mean(EN);                        % Mean ex ante expected tree survival, including non take up
mPEN = mean(EN.*PartProb);              % Mean ex ante expected tree survival, unconditional
mOV = mean(df.*OV);                     % Option Value, including non take up
mPOV = mean(df.*OV.*PartProb);          % Option Value, unconditional


end